package com.shxc.smarttrade.dialogactivity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.shxc.smarttrade.R;
import com.shxc.smarttrade.base.NoActionBarBaseActivity;
import com.shxc.smarttrade.utils.AppUtils;
import com.shxc.smarttrade.utils.ToastUtils;

import org.xchris.view.annotation.ContentView;
import org.xchris.view.annotation.Event;
import org.xchris.view.annotation.ViewInject;

import java.util.Calendar;
import java.util.Date;

/**
 * 第一次登录
 */
@ContentView(R.layout.activity_dialog_firstlogin)
public class FirstLoginDialogActivity extends NoActionBarBaseActivity {

    @ViewInject(R.id.timecount_textview)
    TextView timecount_textview;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Date date = AppUtils.getDateAfter(new Date(), 5);
        Calendar cal=Calendar.getInstance();
        cal.setTime(date);
        timecount_textview.setText("失效时间：" + cal.get(Calendar.YEAR) + "-" + cal.get(Calendar.MONTH)+1 + "-" + cal.get(Calendar.DAY_OF_MONTH));
    }

    @Event({R.id.close_imageview, R.id.close_view})
    private void onClick(View view) {
        switch (view.getId()) {
            case R.id.close_view:
            case R.id.close_imageview:
                finish();
                break;
        }
    }
}
